<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>grid布局</title>
    <style>
        .container {
            height: 600px;
            display: grid;
            gap: 15px;
            grid-template-columns: repeat(3, 33%);
            grid-template-rows: 100px 100px 100px;
            grid-template-areas: 'a1 a1 a2'
                'a1 a1 a4'
                'a3 a5 a4'
            ;
        }

        .item {
            padding: 5px;
        }

        .item1 {
            grid-column-start: 1;
            grid-column-end: 3;
            grid-row-start: 1;
            grid-row-end: 3;
            background-color: red;
        }

        .item2 {
            background-color: yellowgreen;
        }

        .item3 {
            grid-area: a3;
            background-color: fuchsia;
        }

        .item4 {
            grid-row-start: 2;
            grid-row-end: 4;
            background-color: darkgray;
        }

        .item5 {
            background-color: darkmagenta;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="item item1">
            1
        </div>
        <div class="item item2">
            2
        </div>
        <div class="item item3">
            3
        </div>
        <div class="item item4">
            4
        </div>
        <div class="item item5">
            5
        </div>
    </div>
</body>

</html>